package per.sunmes.cl.g.sys;

import per.sunmes.cl.g.i.CallBack;

import com.badlogic.gdx.utils.SnapshotArray;

public class GCB {
	private static Object[] calls;
	// ///////////////
	public static final SnapshotArray<CallBack> viewUpdateCallBacks = new SnapshotArray<CallBack>();

	public static void viewUpdateCall() {
		calls = viewUpdateCallBacks.begin();
		for (Object call : calls) {
			if (call != null) {
				((CallBack) call).call();
			}
		}
		viewUpdateCallBacks.end();
	}

	// ////////
	public static final SnapshotArray<CallBack> gamePauseCallBacks = new SnapshotArray<CallBack>();

	public static void gamePauseCall() {
		calls = gamePauseCallBacks.begin();
		for (Object call : calls) {
			if (call != null) {
				((CallBack) call).call();
			}
		}
		gamePauseCallBacks.end();
	}

	// ////////
	public static final SnapshotArray<CallBack> gameResumeCallBacks = new SnapshotArray<CallBack>();

	public static void gameResumeCall() {
		calls = gameResumeCallBacks.begin();
		for (Object call : calls) {
			if (call != null) {
				((CallBack) call).call();
			}
		}
		gameResumeCallBacks.end();
	}
	// //////////

}
